/*
 *  Copyright 2009 Jamie Gennis <jgennis@gmail.com>.
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */

package com.google.code.gwt.remoteaction.merge.client;

import com.google.code.gwt.remoteaction.client.Action;
import com.google.code.gwt.remoteaction.client.RemoteAction;
import com.google.code.gwt.remoteaction.client.RemoteActionService;
import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * An action service for testing the GWT Remote Action Merge module.
 *
 * @author Jamie Gennis <jgennis@gmail.com>
 */
public interface Service extends RemoteActionService {

  public static class GetTwo implements MergeableAction {

    @Override
    public boolean equals(Object object) {
      return getClass().equals(object.getClass());
    }

    @Override
    public int hashCode() {
      return getClass().hashCode();
    }
  }

  public static class GetThree implements MergeableAction {

    @Override
    public boolean equals(Object object) {
      return getClass().equals(object.getClass());
    }

    @Override
    public int hashCode() {
      return getClass().hashCode();
    }
  }

  public static class GetFive implements Action {

    @Override
    public boolean equals(Object object) {
      return getClass().equals(object.getClass());
    }

    @Override
    public int hashCode() {
      return getClass().hashCode();
    }
  }

  public static class ExceptionThree extends Exception implements IsSerializable {
  }

  @RemoteAction(GetTwo.class)
  public int getTwo();

  @RemoteAction(GetThree.class)
  public int getThree() throws ExceptionThree;

  @RemoteAction(GetFive.class)
  public int getFive();
}
